package com.puppet.building182.mapper;

import com.puppet.building182.pojo.Owner;
import com.puppet.building182.pojo.VO.OwnerVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OwnerMapper {

    List<Owner> getOwners(String searchQuery);

    Integer addOwner(Owner owner);

    Integer deleteOwnerById(Integer id);

    Integer deleteOwner(@Param("ids") List<Integer> ids);

    Integer updateOwner(Owner owner);

    Owner getOwnerById(Integer id);

    List<OwnerVo> getOwnerNameAndId();

    @Select("SELECT COUNT(*) FROM `owner_info` WHERE house_id=#{houseId}")
    Integer selectById(Integer id);
}
